 var ScrollChange={
     bar:null,
     barH:null,
     head:null,
     headH:null,
     dhH:null,
     dh:null,
     dhcss:null,
     init:function (head,dh){
         /*
         * head  头部框 clssname
         * dh  导航条 classname
         * */
         var bar='.header-bar';
         head='.'+head;
         dh='.'+dh;
         var _this=this;
         this.head=document.querySelector(head);
         this.headH=parseInt(getComputedStyle(this.head).height);

         this.dh=document.querySelector(dh);
         this.dhH=parseInt(getComputedStyle(this.dh).height);
         this.dhcss=getComputedStyle(this.dh).cssText;

         this.dhcss.position=getComputedStyle(this.dh).position;
         this.dhcss.zIndex=getComputedStyle(this.dh).zIndex;
         this.dhcss.top=getComputedStyle(this.dh).top;


         var time=setInterval(function(){
             if(document.querySelector(bar)){
                 _this.bar=document.querySelector(bar);
                 _this.barH=parseInt(getComputedStyle(_this.bar).height);
                 _this.change();
                 clearInterval(time);
             }
             else{
                 _this.bar=document.querySelector(bar);
             }
         },10);
     },
     change:function(){
         var _this=this;
         document.body.addEventListener('touchstart',f1=function(e){
             var t=document.body.scrollTop;
             var start= e.touches[0].clientY;
             document.body.addEventListener('touchmove',f2=function(e){
                 var d= e.touches[0].clientY-start;
                 if( t - d - _this.headH > 0){
                     _this.dh.style.position='fixed';
                     _this.dh.style.zIndex=4;
                     _this.dh.style.top='0%';
                 }else{
                     if(_this.dhcss.position)
                         _this.dh.style.position=_this.dhcss.position;
                        else
                         _this.dh.style.position='';

                     if(_this.dhcss.top)
                         _this.dh.style.top=_this.dhcss.top;
                     else
                         _this.dh.style.top='';
                     if(_this.dhcss.zIndex)
                         _this.dh.style.zIndex=_this.dhcss.zIndex;
                     else
                         _this.dh.style.zIndex='';
                     //_this.dh.style.cssText= _this.dhcss;
                 }
                 document.body.addEventListener('touchend',function(e){
                     document.body.removeEventListener('touchmove',f2);
                 },false);
             },false);
         },false);

         window.onscroll=function(){
             if( parseInt(document.body.scrollTop) >_this.headH ){
                 _this.dh.style.position='fixed';
                 _this.dh.style.zIndex=4;
                 _this.dh.style.top='0%';
             }else  if(parseInt(document.body.scrollTop) -( _this.headH + _this.barH) < 0 ){
                 if(_this.dhcss.position)
                     _this.dh.style.position=_this.dhcss.position;
                 else
                     _this.dh.style.position='';

                 if(_this.dhcss.top)
                     _this.dh.style.top=_this.dhcss.top;
                 else
                     _this.dh.style.top='';
                 if(_this.dhcss.zIndex)
                     _this.dh.style.zIndex=_this.dhcss.zIndex;
                 else
                     _this.dh.style.zIndex='';
                 //_this.dh.style.cssText= _this.dhcss;
             }
         }
     }
 };